import axios from './axios'
import qs from 'qs'

import {appUrl} from '@/config/config'
// 用户缴费统计
export const userPartyDuesPayStatistics = (params) => {
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/school/api/home/userPartyDuesSettings/userPartyDuesPayStatistics',
            method: 'get',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 用户党费列表
export const recordUserPartyDuesPays = (params) => {
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/school/api/home/recordUserPartyDuesPays',
            method: 'get',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 支付接口
export const pay = (params) => {
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/school/api/home/recordUserPartyDuesPays/pay',
            method: 'post',
            data: params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 刷新订单状态
export const refreshPayState = (params) => {
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/school/api/home/recordUserPartyDuesPays/refreshPayState',
            method: 'post',
            data: params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 已读
export const readRecordPartyDues = (params) => {
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/school/api/home/recordUserPartyDuesPays/readRecordPartyDues',
            method: 'post',
            data: params
        }).then(res => {
            resolve(res.data)
        })
    })
}
